Northwoods.GoWPF 2.2.4 Assembly
LoadFromXElement Method (TreeModelNodeData<NodeKey>)

the XElement
Initialize this node data with data held in a Linq for XML XElement.
Syntax
Public Overridable Sub LoadFromXElement( _
   ByVal e As XElement _
) 
public virtual void LoadFromXElement( 
   XElement e
)

Parameters

e
the XElement
Remarks

This sets this node data's properties by reading the data from attributes and nested elements of the given XElement.

Because the NodeKey type might be a type for which we have an implementation to convert to and from strings for XML, this calls the ConvertStringToNodeKey method, which you can override.

This is implemented as: public virtual void LoadFromXElement(XElement e) { this.Key = XHelper.Read<NodeKey>("Key", e, default(NodeKey), ConvertStringToNodeKey); this.Category = XHelper.Read("Category", e, ""); this.ParentKey = XHelper.Read<NodeKey>("ParentKey", e, default(NodeKey), ConvertStringToNodeKey); this.ChildKeys = (IList<NodeKey>)XHelper.ReadElements<NodeKey>(e.Element("ChildKeys"), "Key", new ObservableCollection<NodeKey>(), ConvertStringToNodeKey); this.IsTreeExpanded = XHelper.Read("IsTreeExpanded", e, true); this.WasTreeExpanded = XHelper.Read("WasTreeExpanded", e, false); this.Location = XHelper.Read("Location", e, new Point(Double.NaN, Double.NaN)); this.Text = XHelper.Read("Text", e, ""); }

If you add properties to this node data class, and if you are using the TreeModel<NodeType,NodeKey>.Save<NodeDataType> and TreeModel<NodeType,NodeKey>.Load<NodeDataType> methods, you should override this method to add new attributes and/or elements as needed, and you should override MakeXElement.

Requirements
See Also

Reference

TreeModelNodeData<NodeKey> Class
TreeModelNodeData<NodeKey> Members

 

 


© Northwoods Software 2017. All Rights Reserved.

Send Feedback